﻿// <copyright file="BoardBase.cs" company="Marcin Wosik">
// Copyright (c) 2010 All Right Reserved
// </copyright>
// <author>Marcin Wosik</author>
// <email>mawo11@gmail.com</email>
// <date>2010-02-25</date>
// <summary></summary>
namespace GameOfLife.GameData
{
    using System.Windows;
    using System.Windows.Controls;

    using GameOfLife.Interfaces;

    public abstract class BoardBase : IBoard
    {
        #region Properties

        public GameSettings Data
        {
            get; set;
        }

        #endregion Properties

        #region Methods

        public IElement GetElementFromCord(Point point)
        {
            lock (Data.Elements)
            {
                for (int e = 0; e < Data.Elements.Count; ++e)
                {
                    IElement element = Data.Elements[e];
                    if (element.CheckCord(point))
                    {
                        return element;
                    }
                }
            }
            return null;
        }

        public virtual void Initialize(Canvas screen)
        {
        }

        #endregion Methods
    }
}